package site.xuxingcan.voiceforwarder;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

import de.robv.android.xposed.XposedBridge;

/**
 * Created by xuxingcan on 16-10-24.
 */
public class XReceiver extends BroadcastReceiver {
    public static final String RELOAD_SETTING_ACTION = "RELOAD_SETTING_ACTION";

    public static IntentFilter getIntentFilter() {
        IntentFilter mIntentFilter = new IntentFilter();
        mIntentFilter.addAction(RELOAD_SETTING_ACTION);
        return mIntentFilter;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null || intent.getAction() == null) {
            return;
        }
        String action = intent.getAction();
        XposedBridge.log("onReceive = " + action);
        if (action.equalsIgnoreCase(RELOAD_SETTING_ACTION)) {
            FileUtil.getInstance().reloadSetting();
        }
    }
}
